# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=minizip-ng
pkgver=3.0.10
pkgrel=1
pkgdesc='Fork of the popular zip manipulation library found in the zlib distribution'
arch=(loong64 x86_64)
url='https://github.com/zlib-ng/minizip-ng'
license=(custom)
depends=(openssl bzip2 zstd)
makedepends=(cmake)
source=(https://github.com/zlib-ng/minizip-ng/archive/$pkgver/$pkgname-$pkgver.tar.gz)
sha256sums=('d4a549731d8c7074e421dbab6d8b8ad0a93067752fe767c464f0f40fa5f0a80d')

build() {
  cmake -B build -S $pkgname-$pkgver \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DMZ_PROJECT_SUFFIX="-ng" \
    -DBUILD_SHARED_LIBS=ON
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
  rm "$pkgdir"/usr/include/{,un}zip.h # Conflict with libzip
  install -Dm644 $pkgname-$pkgver/LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
}
